{layout name="./base/base_back"}
		<link rel="stylesheet" type="text/css" href="/front/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="/front/css/publishWish.css"/>
		<link rel="stylesheet" type="text/css" href="/front/css/jquery-ui.css"/>
		<link rel="stylesheet" type="text/css" href="/front/css/weifeng.css"/>
		<script src="/front/js/jquery.js" type="text/javascript"></script>
		<script src="/front/js/jquery.cxselect.js" type="text/javascript"></script>
		<script src="/front/js/jquery-ui.js" type="text/javascript"></script>
		<script src="/front/js/weifeng.js" type="text/javascript"></script>
		<script type="text/javascript">
			//数组状态：分享中
			var arr1 = [ "{$share|implode='","',###}"];
			//数组状态：分享成功
			var arr2 = [ ""];
			//数组状态：出租成功
			var arr3 = [ "{$disables|implode='","',###}"];
			//数组状态：出租中
			var arr4 = [ "{$rent|implode='","',###}"];
			var arr4a = {$renta};

			//判断日期，并设置其状态样式
			function selectedate(date) {
			  var d = formatterDate(date);
			  if($.inArray(d, arr3)!=-1){
			    return [false,'','出租成功'];
			  }else if($.inArray(d, arr4)!=-1){
			  	var dd = arr4a[''+String(d)+''];
			  	return [true,'blue','出租中,单日价格：'+String(dd)];
			    
			  }else if($.inArray(d, arr1)!=-1){
			    return [true,'red','分享中'];
			  }else if($.inArray(d, arr2)!=-1){
			    return [false,'','分享成功'];
			  }else
			  return [true];
			}
		</script>
		<!--顶部导航结束-->
		<!--会员注册审核开始-->
		<div id="publish-wish-box">
			<div id="publish-wish">
				{include file="./navleft"}
				<div class="publish-wish-right">
					<div class="publish-wish-tit">房车出租设置</div>
					<div class="setshare">
						<div class="mt15">
							<div class="setcalendar fl">
								<div>
									<span class="red">红色边框为分享状态</span>
									<span class="blue">蓝色边框为出租状态</span>
								</div>
		                        <div id="datepicker"></div>
		                        <div id="datepicker1"></div>
								<script type="text/javascript">
									datePickerById1('#datepicker','#startdaterent','#endaterent');
									datePickerById1('#datepicker1','#startdaterentesc','#endaterentesc');
									$(function(){
										$("#datepicker1").hide();
										$("#datepicker").show();
										$(".tab_setdatemenu ul li:nth-child(1)").click(function(){
											$("#datepicker1").hide();
											$("#datepicker").show();
										});
										$(".tab_setdatemenu ul li:nth-child(2)").click(function(){
											$("#datepicker").hide();
											$("#datepicker1").show();
										});
										
									})
								</script>
							</div>
							<div class="setdate fr">
								<div class="tab_setdatemenu">
									<ul>
										<li class="on fl">设置出租</li>
										<li class="fl">取消出租</li>
									</ul>
								</div>
								<div class="cb"></div>
								<div class="tab_setdatebox">
									<div>
										<form action="sharecaravan" method="post" id="share">
											<input type="hidden" id="caravan_id" name="caravan_id" value="{$caravan_id}">
											<div class="fl w">
												<div class="fl" style="width:49%">
													<label>开始日期</label>
													<input type="text" id="startdaterent" name="startdaterent" placeholder="请选择开始日期" value="">
												</div>
												<div class="fr" style="width:49%">
													<label>结束日期</label>
													<input type="text" id="endaterent" name="endaterent" placeholder="请选择结束日期">
												</div>
											</div>
											<div class="fl" style="width:100%">
													<label>单日价格（现金）</label>
													<input type="text" id="cash" name="single_day_price" placeholder="请填写单日价格" value="{$rent_money_base}">
											</div>
											<p>小贴士： 每晚价格{$integral}
												<span onmouseover="show(this,'codetips');" onmouseout="hide(this,'codetips');"></span>
												<div id="codetips" style="position:absolute;display:none;border:1px solid silver;background:#eee;padding: 10px;">选择什么样的价格完全由您决定，系统会根据您房车的位置、季节、供求关系等，自动提供有关价格和可分享状态的小窍门</div>
											</p>
											<br>
											
											<hr style="width:100%;">
											<a href={php} echo url("/filter/relist",'','','www') {/php}>马上去租房车</a>
											<div id="setsharebtn">提交</div>
										</form>
									</div>
									<div>
										<form action="" method="post" id="cancelshare">
											<input type="hidden" id="caravan_id" name="caravan_id" value="{$caravan_id}">
											<div class="fl" style="width:49%">
												<label>开始日期</label>
												<input type="text" name="csdate" id="startdaterentesc" placeholder="2016-12-01">
											</div>
											<div class="fr" style="width:49%">
												<label>结束日期</label>
												<input type="text" name="cedate" id="endaterentesc" placeholder="2016-12-01">
											</div>
											<p>取消后，其他用户将不能检索到您的房车
												<span onmouseover="show(this,'delsharetips');" onmouseout="hide(this,'delsharetips');"></span>
												<div id="delsharetips" style="position:absolute;display:none;border:1px solid silver;background:#eee;padding: 10px;">房车被预订后，系统不允许取消。</div>
											</p>
											<br>
											<hr style="width:100%;">
											<hr style="width:100%;">
											<div href="###" id="delsharebtn">确认取消</div>
										</form>
									</div>
								</div>
							</div>
							<!-- 提交分享弹出框提示start -->
							<div class="setsharetip fr">
								<h4>您确定出租吗？</h4>
								<p>出租时间：<span id="sdate"></span>到<span id="edate"></span></p>
								<p>获得金额：<span id="cashes"></span></p>
								<br>
								<p>
								1.设置出租后，请提前48小时将钥匙交到管理员处！
								</p>
								<p>
								2.房车出租成功，其他用户订单完成后，相应金额汇入您的账户！
								</p>
								<p>
								3.取消政策：房车出租成功后将不能取消。请慎重设置！
								</p>
								<hr style="width:100%;">
								<a>取消</a>
								<button type="submit" id="sure">确定</button>
							</div>
							<script type="text/javascript">
								$(function(){
									$(".setshare .setdate #setsharebtn").click(function(){
										$(".setshare .setdate").hide();
										$(".setshare .setsharetip").show();
										$('#sdate').text($('#startdaterent').val());
										$('#edate').text($('#endaterent').val());
										$.post("/setcaravan/cash",
										    {
										    	caravan_id:$('#caravan_id').val(),
											    startdaterent:$('#startdaterent').val(),
											    cash:$('#cash').val(),
											    endaterent:$('#endaterent').val()
										    },
										    function(data,status){
										    	$('#cashes').text(data);
										    });
									})
									$("#sure").click(function(){
								        $("#share").attr('action','/setcaravan/rentcaravan');
										$("#share").submit();
								      });
									$(".setshare .setsharetip a").click(function(){
										$(".setshare .setdate").show();
										$(".setshare .setsharetip").hide();
									})
								})
							</script>
							<!-- 提交分享弹出框提示end -->
							<!-- 取消分享弹出框提示start -->
							<div class="delsharetip fr">
								<h4>您确定取消出租吗？</h4>
								<p>取消时间：<span id="cancelsdate"></span>到<span id="canceledate"></span></p>
								<br>
								<hr style="width:100%;">
								<a>取消</a>
								<button type="submit" id="cancel">确定</button>
							</div>
							<script type="text/javascript">
								$(function(){
									$(".setshare .setdate #delsharebtn").click(function(){
										$(".setshare .setdate").hide();
										$(".setshare .delsharetip").show();
										$('#cancelsdate').text($('#startdaterentesc').val());
										$('#canceledate').text($('#endaterentesc').val());
									})
									$("#cancel").click(function(){
								        $("#cancelshare").attr('action','/setcaravan/cancelrent');
										$("#cancelshare").submit();
								      });
									$(".setshare .delsharetip a").click(function(){
										$(".setshare .setdate").show();
										$(".setshare .delsharetip").hide();
									})
								})
							</script>
							<!-- 取消分享弹出框提示end -->
							<div class="cb"></div>
						</div>
					</div>
					<div class="publish-wish-form">
						<dl>
							<dt>出租及取消规则</dt>
							<dd>1.设置出租后，请提前48小时将钥匙交到管理员处！</dd>
							<dd>2.房车出租成功，其他用户订单完成后，相应金额汇入您的账户！</dd>
							<dd>3.取消政策：房车出租成功后将不能取消。请慎重设置！</dd>
						</dl>
					</div>
				</div>
				<div class="cb"></div>
			</div>
		</div>
		<!--会员注册审核结束-->


